//
//  GSSearchBar.m
//  GameSky
//
//  Created by lanou on 16/1/11.
//  Copyright © 2016年 NiRongfei. All rights reserved.
//

#import "GSSearchBar.h"

#define kBgViewMargin 8
#define kBgViewH 6
#define kSearchImageVW 20
#define kSearchImageVH 20


@implementation GSSearchBar

- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        
        self.bgView = [[UIView alloc]init];
        
        self.searchImageV = [[UIImageView alloc]init];
        
        [self.bgView addSubview:self.searchImageV];
        
        self.searchLabel = [[UILabel alloc]init];
        
        
        self.searchLabel.textColor = kRGBColor(0.78, 0.63, 0.62);
        
        [self.bgView addSubview:self.searchLabel];
        
        
    }
    
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    
    self.bgView.frame = CGRectMake(kBgViewMargin, kBgViewH, self.width - 2 * kBgViewMargin, 30);
    
    self.searchImageV.frame = CGRectMake(self.bgView.center.x - kSearchImageVW, (self.bgView.height - kSearchImageVH) / 2, kSearchImageVW, kSearchImageVH);
    
    self.searchImageV.image = [UIImage imageNamed:@"common_Icon_Search_20x20_UIMode_Day.png"];
    
    self.searchLabel.frame = CGRectMake(self.searchImageV.right, (self.bgView.height - 18) / 2, 30, 18);
    
    self.searchLabel.text = @"搜素";
    
    
}


@end
